from django.conf.urls.defaults import patterns, include, url

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('tsworkbench.views',
    url(r'^$', 'home', name='home'),
    url(r'^help$', 'help'),
    url(r'^about_us$', 'aboutUs'),
    url(r'^exportWorkspace$', 'exportWorkspace'),
    url(r'^importWorkspace$', 'importWorkspace'),
)

urlpatterns += patterns('tsworkbench.views.ts',
    url(r'^ts/$', 'home', name='home'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/view$', 'viewTP'),
    url(r'^ts/(?P<tp_name>[\w]+)/delete$', 'delTP'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/factor/add$', 'addFactor'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/factor/(?P<f_name>\w+)/delete$', 'delFactor'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/factor/(?P<f_name>\w+)/edit$', 'editFactor'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/gene/add$', 'addGene'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/gene/(?P<g_name>\w+)/edit$', 'editGene'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/gene/(?P<g_name>\w+)/delete$', 'delGene'),
    url(r'^ts/toTranssys/(?P<tp_name>[\w|\W]+).tra$', 'toTranssys'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/codeTranssys$', 'codeTranssys'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/toPDF$', 'getPDF'),
    url(r'^ts/toImage/(?P<tp_name>[\w|\W]+).svg$', 'getImage'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/runTimestep$', 'createTranssysInstance'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/downloadSimulationData$', 'downloadSimulationData'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/plotTimeSeries/(?P<f_name>\w+)/(?P<thumbnail>\w+).png$', 'plotTimeSeries'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/plotAttractors/(?P<f_name1>\w+)/(?P<f_name2>\w+)/(?P<thumbnail>\w+).png$', 'plotAttractors'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/downloadAttractorsResult$', 'downloadAttractors'),
    url(r'^ts/initialstates/(?P<initial_state_name>\w+)$', 'getInitialState'),
    url(r'^ts/(?P<tp_name>[\w|\W]+)/identifyAttractors$', 'identifyAttractors'),
    url(r'^ts/addTranssysProgram$', 'addTranssysProgram'),
    url(r'^ts/uploadTranssysProgram$', 'uploadTranssysProgram'),
)

urlpatterns += patterns('tsworkbench.views.sgx',
    # Examples:
    url(r'^sgx/$', 'home', name='home'),
    url(r'^sgx/addSgx$', 'addSgx'),
    url(r'^sgx/uploadSgx$', 'uploadSgx'),
    url(r'^ts/toSgx/(?P<sgx_name>[\w|\W]+).sgx$', 'toSgx'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/view$', 'viewSgx'),
    url(r'^sgx/(?P<sgx_name>[\w]+)/del$', 'delSgx'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/procedure/add$', 'addProcedure'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/procedure/(?P<pro_name>\w+)/edit$', 'editProcedure'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/procedure/(?P<pro_name>\w+)/del$', 'delProcedure'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/simexpression/add$', 'addSimexpression'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/simexpression/(?P<simex_name>\w+)/edit$', 'editSimexpression'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/simexpression/(?P<simex_name>\w+)/del$', 'delSimexpression'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/measurementMatrix/add$', 'addMeasurementMatrix'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/discrimination/add$', 'discriminationSetting'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/runSimulation$', 'runSimulation'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/downloadsimulatedData/(?P<tp_name>\w+)$', 'downloadSimulatedData'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/codeSimgenex$', 'codeSimgenex'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/compareTranssysModel$', 'compareTranssysModel'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/examineTranssysModel$', 'examineTranssysModel'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/uploadExpressionSet$', 'uploadExpressionSet'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/viewExpressionSet/(?P<ex_name>\w+)$', 'viewExpressionSet'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/delExpressionSet/(?P<ex_name>\w+)$', 'delExpressionSet'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/addTargetTp$', 'addTargetTp'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/delTargetTp/(?P<tp_name>\w+)$', 'delTargetTranssysProgram'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/getMeasurementColumns/(?P<transformation>[\w|\W]+)/(?P<reference_column>[\w|\W]+)$', 'getMeasurementColumns'),
    url(r'^sgx/(?P<sgx_name>[\w|\W]+)/getGeneMapping/(?P<tp_name>\w+)$', 'getGeneMapping'),
)
